Consolidation of allocated memory to reduce power consumption

ABSTRACT

A memory system includes physical memory devices or ranks of memory devices that can be set to reduced power modes. In one embodiment, a hardware memory controller receives memory instructions in terms of a logical address space. In response to the relative usages of different addresses within the logical address space, the memory controller maps the logical address space to physical memory in a way that reduces the number of memory devices that are being used. Other memory devices are then set to reduced power modes. In another embodiment, an operating system maintains a free page list indicating portions of physical memory that are not currently allocated. The operating system periodically sorts this list by group, where each group corresponds to a set or rank of memory devices. The groups are sorted in order from those receiving the heaviest usage to those receiving the lightest usage. When allocating memory, the memory is allocated from the sorted page list so that memory is preferentially allocated from those memory devices that are already receiving the highest usage.

TECHNICAL FIELD

[0001] This invention relates to power conservation in memory devices and systems.

BACKGROUND

[0002] Dynamically refreshed memory, usually referred to as dynamic random access memory or DRAM, is a type of memory device found in many different computing devices. A typical DRAM device may have millions, billions or even more DRAM memory cells. A DRAM memory cell is commonly formed by a single transistor and an associated capacitance. The capacitance is charged to a voltage that indicates a bit value of either “0” or “1”. The capacitance loses its charge rather quickly, bringing about the need for periodic refreshing.

[0003] In many computer systems, the power consumption of DRAM memory is insignificant compared to other system components such as hard disks, high-performance microprocessors, active matrix displays, CRTs, etc. However, in other computer systems, such as the newly emerging and evolving class of mobile devices known as “handhelds” or “PDAs” (“personal digital assistants”), the power consumption of the DRAM memory is significant as compared to other components in the computer system. In comparison to many of the more traditional types of computers, such as desktop or personal computers, many mobile computing devices, are smaller, less capable, and use components that consume less power. For example, many of these systems have small, monochromic displays, low performance CPUs, and no hard disks. Some of these mobile systems, furthermore, rely on batteries for their operating power. As a result of these factors, power consumption of memory subsystems has become more of an issue in these devices; there is a strong need to reduce memory power consumption and to thereby extend the time between required battery replacement or recharging.

[0004] Memory devices with power management features are becoming available to address this need. For example, DRAMs are available that support various different reduced power modes. However, power savings come at the cost of performance. Typically, a greater penalty in access speed is imposed at each increasing degree of power savings. Thus, decisions regarding whether to invoke power-saving features in a DRAM should be made intelligently. Typically, it is desired to initiate a low power mode in a particular memory device only when that memory device is not currently in use and is not anticipated to be in use in the near future.

[0005] It is difficult, however, to anticipate the future need for accessing any particular region of memory. Furthermore, modem operating systems typically allocate memory without regard to memory device boundaries, making it difficult to find a single memory device that can appropriately be set to a reduced power mode without significantly impacting overall system performance. More specifically, typical memory allocation schemes often result in a highly fragmented memory space, with allocated pages of memory spread more or less randomly across the available range of physical memory. Because allocated memory is normally spread across all of the available devices, none of the devices can be put into a reduced power mode without seriously impacting memory performance.

[0006] An article entitled “Power Aware Page Allocation,” by authors Alvin R. Lebeck, Xiaobo Fan, Heng Zeng, and Carla Ellis, in Proceedings of the Ninth International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS-IX) (November, 2000), discusses the desirability of clustering memory page allocations into the minimum number of memory devices. Such clustering allows other devices to be put into reduced power modes.

[0007] Described below are specific techniques for minimizing the number of actual DRAM devices being used in a system at any particular time. Such techniques can be implemented in existing systems with very little overhead, while potentially achieving significant power savings.

BRIEF DESCRIPTION OF THE DRAWINGS

[0008]FIG. 1 is a block diagram of a memory system that incorporates aspects of the invention.

[0009]FIG. 2 shows a logical-to-physical mapping table used in conjunction with the memory system of FIG. 1.

[0010]FIG. 3 is a block diagram of a memory device that can be utilized in conjunction with the memory system of FIG. 1.

[0011]FIG. 4 is a block diagram of an alternative memory system that incorporates aspects of the invention.

[0012]FIG. 5 shows a virtual-to-physical mapping table used in conjunction with the memory system of FIG. 4.

[0013]FIG. 6 illustrates a free page list used in conjunction with the memory system of FIG. 4.

DETAILED DESCRIPTION

[0014] Memory Consolidation by Logical-to-Physical Re-mapping

[0015]FIG. 1 shows pertinent portions of a computer system 10, including a CPU 12, a memory controller 14, and memory devices 16. Although the memory controller and memory devices are shown to be separate entities in this figure, the same techniques apply for memory controllers that are integrated into the CPU, as well as memory that is integrated with either the controller and/or the CPU.

[0016] The computer system also includes an operating system 18 and one or more applications or application programs 20. The operating system and applications are typically initially stored on some form of non-volatile memory (not shown). They are subsequently loaded into executable memory and executed by CPU 12. Devices 16 form at least part of the executable memory. In many cases, the computer system implements a virtual memory system, so that only portions of the operating system and applications are actually present in physical memory at any given time.

[0017] The architecture of FIG. 1 is typical of many computers and computer-like devices, and is not limited to conventional desktop systems or even to conventional portable computer systems. Many types of devices, such as entertainment and game devices, industrial control devices, and others either use an architecture such as this or can be easily adapted to use such an architecture.

[0018] The operating system is typically an off-the-shelf, general-purpose operating system that provides low-level management functions and support for higher-level application programs. However, the operating system might alternatively be a custom application or program designed for a particular, specialized purpose, and might itself perform the specialized functions that would in other cases be performed by separate application programs.

[0019] In the described embodiment, memory devices 16 have dynamically refreshable memory cells. Such devices are typically referred to as DRAMs (dynamic random access memory), or DRAM devices. Other types of memory devices can, however, also benefit from the techniques described herein.

[0020] Memory devices 16 can be arranged in many different configurations. Typically, memory devices are arranged in sets or ranks, with each device storing a single bit or other portion of a digital word. The bits or portions are then combined or grouped when writing to or reading from a particular memory address. Decisions regarding whether devices are to be operated in reduced power modes are typically made with respect to all of the devices of a particular set or rank. For purposes of discussion, it is assumed that each block 16 in FIG. 1 represents a set or rank of one or more memory devices, which are configured as a group in different power modes.

[0021] Memory controller 14 acts as an interface between CPU 12 and memory devices 16. Memory controller 14 has refresh logic 21 that is configured to periodically refresh the memory cells of the memory devices. Although not shown, each of memory devices 16 has multiple dynamically refreshable memory cells, arranged in rows. In operation, memory controller 14 can receive memory instructions from various sources, including but not limited to, operating system 18, CPU 12, a graphics adapter (not shown), and/or other sources. Memory controller 14 responds to the instructions by performing various memory operations such as, for example, reads and writes. When performing a memory operation, the memory controller specifies particular memory cells by means of a physical address or a combination of addresses (such as row and column addresses). For purposes of the following discussion, these memory addresses will be referred to as physical addresses, and the available range of physical memory addresses will be referred to as the physical address space.

[0022] Instructions received by memory controller 14 from CPU 12 specify addresses in terms of an address space that is normally referred to as a physical address space, but which for purposes of the following discussion will be referred to as a logical address space. The term “physical address space” will be used to refer to the range of addresses occupied by memory devices 16. In many prior art systems, these two address spaces are equivalent. In the described embodiment, however, there is a variable mapping between logical addresses used between CPU 12 and memory controller 14 and physical addresses used between memory controller 14 and memory devices 16.

[0023] The logical address space is a linear range of addresses that is mapped by memory controller 12 to the physical address space occupied by memory devices 16. As will be seen, mappings of the logical address space to the physical address space are variable—they change over time. However, this variability is transparent to the CPU. To the CPU, the logical address space appears simply as a linear address space. All memory references by the CPU are specified in terms of the logical addresses that form the logical address space.

[0024] More specifically, memory controller 14 has mapping logic or address translation logic 22 that maps or translates from logical addresses specified in memory instructions to physical addresses used to access physical memory devices 16. Such mapping is performed in a manner that reduces or minimizes the number of physical memory devices or ranks of memory devices that are in use at any given time. After minimizing the number of physical memory devices that are in use, the memory controller sets other memory devices—those that are either unused or are subject to relatively less usage—to reduced power modes.

[0025] More specifically, memory controller 14 repeatedly performs actions of (a) identifying portions of the logical address space based on usage, (b) mapping the identified portions of the logical address space to physical memory in a manner that reduces the number of physical memory devices referenced by the identified portions of the logical address space, (c) identifying one or more memory devices that are not referenced by the identified portions of the logical address space, and (d) setting said one or more identified memory devices to one or more reduced power modes. These actions will be described in more detail in the following discussion.

[0026]FIG. 2 shows a logical-to-physical address translation table 30 such as might be used to implement address translation logic 22. Logical-to-physical address translation can be done on at the byte level (that is, each byte of the logical address space can be mapped to a different byte in the physical address space), but in practice this requires the translation table to be too large. In practice (and in the preferred embodiment), entries of the translation table correspond to groups of bytes in the logical address space (for example, the number of bytes in a physical page, a DRAM page, a DRAM bank, or even a rank of DRAMs). Throughout the remainder of this description, the term “logical page” will be used to represent groups of addresses in the logical address space that map to groups of addresses in the physical address space.

[0027] Table 30 has a plurality of mappings or entries 31, each of which indicates a logical page address or number in a first column 32 and a corresponding targeted physical page address or number in a second column 33. For purposes of discussion, a particular physical page address or number will be said to be the “target” of a logical-to-physical mapping whenever there is an entry in table 30 that maps to said particular physical page address or number.

[0028] When a received memory instruction specifies a particular logical address or logical page number, memory controller 14 translates it to a physical address or physical page number by referencing the appropriate entry of the address translation table. In accordance with the techniques described herein, memory controller 14 repeatedly and/or periodically modifies the mappings of table 30 to reduce the number of physical memory devices that are targeted by the mappings.

[0029] Monitoring Memory Instructions to Identify In-Use Memory

[0030] In one embodiment, memory controller 14 identifies highly used portions of the logical address space by monitoring memory instructions and keeping track of which logical addresses or logical memory pages are specified most frequently and/or most recently in the memory instructions. In this embodiment, memory controller 14 is configured to periodically re-map the logical address space to physical memory, to reduce the number of physical memory devices referenced by the identified, highly-used portions of the logical address space. Specifically, the address translation entries are periodically re-calculated so that the most frequently and/or recently used logical memory addresses map to physical memory that is located in the fewest possible number of physical memory devices or ranks. Depending on system constraints which set the maximum power consumption of the memory system, the most frequently and/or recently used logical addresses can be mapped to devices that consume more power (and which have the highest performance), such as devices operating in “Attention” and “Standby” modes available in “Direct RDRAM” memory devices manufactured by Rambus Inc., of Los Altos, Calif. Logical addresses that are used less frequently and/or less recently can be mapped to devices that consume less power (and which have lower performance), such as devices operating in “Nap” or “Powerdown” modes of “Direct RDRAM” memory devices. In conjunction with this re-mapping process, memory content is copied or moved as appropriate so that all logical memory addresses will continue to reference the same data even though the data might now be in a different physical location.

[0031] Operating System Notifications of In-Use Memory

[0032] In other embodiments, memory controller 14 receives explicit notifications from operating system 18 regarding allocations and de-allocations of memory. These notifications preferably indicate one or more logical memory pages that are being allocated or de-allocated.

[0033] Typically, an operating system includes facilities for dynamically allocating and de-allocating memory. When loading an application, for example, an operating system typically designates specific areas of memory for the code of the application and specific areas of memory for use by the program in storing data. Allocation and de-allocation typically involve maintaining one or more tables or other data structures indicating those areas of memory that have been designated for use in this manner. Such areas are typically identified within such tables or data structures by their memory addresses—by their physical memory addresses in most prior art systems, but by their logical addresses in the embodiments described herein.

[0034] Memory allocation can also take place as a result of an application program requesting the use of additional memory during actual execution of the application program. In response to requests such as this, the operating system designates areas of memory (which in the described embodiment comprise logical memory) for exclusive use by the requesting application programs.

[0035] In operating systems that support virtual memory, allocation of physical memory typically takes place at a lower level. Systems such as this create an individual virtual address space for each of multiple application programs. Each virtual address space is very large—typically much larger than the amount of available physical memory.

[0036] In systems such as this, the operating system typically allocates virtual memory to requesting application programs. When such virtual memory is allocated, the operating system creates a translation entry or “mapping” between an allocated range of virtual memory addresses and a corresponding range of physical memory addresses—in the embodiments described herein, each mapping is between a range of virtual memory addresses and a corresponding range of logical memory addresses. Each translation entry or mapping translates from a virtual or source address to a logical or target address. The operating system maintains a translation or mapping table that contains all current translations or mappings.

[0037] When an application program subsequently references a virtual memory address, the operating system and CPU use the translation table to translate from the virtual address to the logical address, and the actual memory access is made to the indicated logical address. This translation process is transparent to the application program.

[0038] In order to make each virtual address space appear relatively unlimited, the operating system makes use of a mass storage medium such as a hard disk, which is typically referred to as secondary storage or secondary memory to distinguish it from primary or physical memory. Secondary storage is usually relatively slow to access, but normally has a capacity much larger than that of primary memory. The operating system monitors memory usage and when portions of virtual memory are not being used, the data from the corresponding portions of physical memory is moved to secondary storage. Thus, at any given time, some portions of virtual memory will correspond to portions of physical memory, and some virtual memory will correspond to portions of secondary memory.

[0039] If an application program attempts to access a portion of virtual memory that is currently held in secondary storage, there will be no appropriate entry in the translation table. This is referred to as a “miss,” in response to which the operating system intervenes, loads the appropriate data back into physical memory and creates an appropriate translation entry in the translation table. After this is accomplished, the control is returned to the application program, which accesses the memory in its normal fashion.

[0040] The process of moving data between primary and secondary storage is referred to as memory “swapping” and normally takes place on an ongoing basis. As part of this process, the operating system maintains and updates its virtual-to-logical address mappings so that any reference to a virtual memory address will be translated to the appropriate logical address. The virtual-to-logical mappings change frequently in response to memory swapping.

[0041] Thus, in systems that support virtual memory, the operating system allocates virtual memory to requesting application programs. Prior to use, however, the operating system loads needed portions of the virtual memory into portions of physical memory, and provides address translations between virtual and logical memory addresses. In systems such as these, logical memory can be considered to be allocated whenever it is the target of an active virtual-to-logical memory mapping as described above. The operating system is configured to notify controller 14 when portions of the logical address space becomes allocated in this fashion.

[0042] Regardless of the method of memory allocation, the operating system is configured to identify allocated portions of the logical memory space to controller 14. Specifically, the operating system informs the memory subsystem of the specific addresses or address ranges that are being allocated or de-allocated. These addresses are specified in terms of the logical address space described above, although such addresses would normally be thought of as “physical” addresses from the point of view of the operating system.

[0043] In response to receiving a notification of a page allocation, memory controller 14 creates a new mapping or translation entry 31 for use by address translation logic 22. As new mappings are created, they are created in a manner that tends to reduce the number of additional memory devices or ranks targeted by the new mappings. Thus, if possible, the new entry is created so that it targets physical memory from a memory device or rank that is already targeted by an existing translation entry. This tends to consolidate physical memory usage in the fewest possible memory devices, allowing non-targeted memory devices to be set to reduced power consumption modes. If it is not possible to allocate the new page from an already targeted memory device or memory rank, the new translation entry is created so that it targets physical memory from a previously untargeted device or rank, and this device or rank may be restored to a non-reduced power consumption mode.

[0044] In response to receiving a notification of a page de-allocation, memory controller 14 deletes the corresponding mapping from table 30. Furthermore, memory controller 14 is configured to periodically re-evaluate its existing memory mappings to ensure that they are targeting the fewest possible number of physical memory devices. The mappings are changed if necessary to achieve this goal, after appropriately copying or moving affected portions of physical memory so that each logical address will continue to reference the same data.

[0045] Re-evaluation of current memory mappings can be triggered in different ways. For example, the memory controller might be configured to re-evaluate its logical-to-physical address mappings at periodic intervals. Alternatively, the mappings might be re-evaluated after each memory allocation or de-allocation, after a pre-defined number of memory pages have been de-allocated, after a pre-defined number of memory references, or whenever the power consumption of the memory system approaches one or more pre-defined or dynamically determined thresholds.

[0046] After adding or deleting mappings, or after re-evaluating the mappings as described above, the memory controller identifies any memory devices or ranks of memory devices that are not currently targeted by logical-to-physical memory mappings. The memory controller then sets these memory devices or device ranks to a reduced power consumption mode, such as a nap, standby, or power-down mode. Alternatively, it might be desirable in some embodiments to identify those devices or device ranks that are targeted by relatively few logical-to-physical memory mappings, or by infrequent or non-recent memory accesses, and to set those devices or device ranks to a reduced power mode. Although in these examples the memory controller is responsible for identifying, tracking, and placing devices into a reduced power mode, it is possible for software (such as the operating system) to perform these functions as well.

[0047] Use Registers to Indicate In-Use Memory

[0048] In yet another embodiment, each memory device includes multiple dynamically changeable use registers such as described in a co-pending U.S. patent application entitled “Monitoring In-Use Memory Areas for Power Conservation” by inventors Steven C. Woo and Pradeep Batra, filed concurrently herewith, which is hereby incorporated by reference.

[0049]FIG. 3 shows a memory device 40 that incorporates use registers 41 such as those referred to in the patent application mentioned above. These registers indicate used and unused memory cells or groups of used or unused memory cells. More specifically, use registers 41 in this embodiment comprise individual bits or flags that are associated respectively with individual memory cell rows 42. Each bit or flag is set to indicate whether or not the corresponding row is actually in use, and whether it therefore needs to be refreshed.

[0050] Memory controller 14 supports and maintains use registers 41 and allows them to be set or programmed by the operating system to indicate which memory rows are actually in use. For example, the operating system might set the use registers to indicate which rows of logical memory are currently allocated. As described in the previously mentioned patent application, use registers 41 allow power-saving measures to be taken with respect to individual memory rows that are not being used. Specifically, the use registers allow refreshing of unused memory rows to be omitted.

[0051] Furthermore, in the described embodiment memory controller 14 monitors use registers 41 to determine which portions of physical memory are in use at any particular time, and periodically modifies logical-to-physical translation table 30 to consolidate in-use memory rows on as few memory devices or memory ranks as possible. Remaining memory devices are then set to reduced power consumption modes such as standby, nap, or power-down modes. Such reduced power modes typically affect entire memory devices or ranks of memory devices, rather than individual rows within such memory devices. However, it is possible that for some designs, reduced power modes may affect portions of memory storage within one or more devices, such as a bank within a DRAM.

[0052] In this embodiment, the address translation logic 22 initially implements default logical-to-physical address mappings in table 30 of FIG. 2. Subsequently, memory controller 14 periodically identifies or re-identifies portions of the logical address space that are in use, by examining use registers 41. Furthermore, memory controller 14 periodically re-maps the identified or re-identified portions of the logical address space that are in use, in a manner that reduces the number of physical memory devices or ranks that are referenced by the in-use portions of the logical address space. Prior to re-mapping any particular range of logical addresses, the memory controller moves any memory content that was previously referenced by such logical addresses so that said memory content will continue to be referenced by the same logical addresses after re-mapping.

[0053] Although the use registers or flags 41 are shown on an individual memory device for purposes of this example, the registers or flags could be physically located elsewhere. For example, they could be located on the memory controller itself, or on some other component other than the memory controller or memory device. Furthermore, such registers could be made to correspond to ranges of logical memory addresses, rather than to physical address rows as shown in FIG. 3.

[0054] Virtual Memory Implementation

[0055]FIG. 4 shows another embodiment, in which similar techniques are implemented within a virtual memory system of computer 10. Shown in FIG. 4 is virtual memory logic 50 for implementing a virtual memory system. In systems such as this, the operating system allocates virtual memory to requesting application programs. Virtual memory can reside at times on secondary storage media such as hard disks. Prior to use, however, the operating system loads needed portions of the virtual memory into portions of physical memory, and provides address translations from virtual memory addresses to physical memory addresses. In this embodiment, memory controller 14 does not perform address translations. Thus, CPU 12 specifies actual “physical” addresses to memory controller 14, and the virtual memory system maintains mappings or translations from virtual memory addresses to physical memory addresses. In this embodiment, the virtual address space can be considered to be a “logical” address space, and similar techniques are used to map from this “logical” or “virtual” address space to the physical address space occupied by memory devices 16.

[0056] It should be noted that although the virtual memory logic is shown as being implemented within operating system 18, the CPU 12 (and potentially other components) typically also has logic for supporting the implementation of virtual memory. Such CPU logic is typically under the control and supervision of the operating system.

[0057]FIG. 5 shows a virtual-to-physical address translation table 60 that forms part of virtual memory logic 50. This table has a plurality of mappings or entries 61, each of which indicates a virtual page address or number in a first column 62 and the corresponding targeted physical page address or number in a second column 63. When referencing a given virtual address or virtual page number, virtual memory logic 50 translates it to a physical address or physical page number by referencing the appropriate entry of the address translation table 60. Virtual memory logic 50 creates a mapping when a corresponding portion or page of virtual memory is loaded into physical memory. When the portion or page of virtual memory is removed from physical memory, the mapping is deleted from table 60. Thus, address translation table 60 is a dynamically changing data structure. At any given time, table 60 reflects only those virtual memory pages that are actually loaded in physical memory. This changes as memory is allocated and de-allocated, and as memory is moved back and forth between secondary storage and physical memory. For purposes of the following discussion, physical memory is considered to be allocated when it is the target of a virtual-to-physical address mapping.

[0058] In one implementation, the virtual memory logic 50 of FIG. 4 is configured to periodically and/or repeatedly identify portions of the virtual address space that are in use, and to repeatedly modify the mappings of table 60 to reduce the number of physical memory devices that are targeted by the mappings. This is similar to the previously discussed embodiments, except that these steps are performed in the virtual memory system rather than in the memory controller.

[0059] In another implementation, the mappings are created in a manner that tends to minimize the number of in-use physical memory devices. In this implementation, the virtual memory logic 50 manages its free page list so that newly allocated pages are allocated from those memory devices that are already receiving the heaviest usage.

[0060]FIG. 6 shows a free page or free region list 70 that is maintained by virtual memory logic 50 in accordance with this implementation. This list contains indications of free memory regions or pages—pages that are not currently targeted by any mapping entry in table 60.

[0061] Free page list 70 is implemented as a linked list of free page or free region indicators 72. Each free page indicator is a data structure containing a physical address or page number and a pointer to the next indicator in the list (unless the indicator is the last in the sequence).

[0062] The free page indicators are grouped, with each group corresponding to a set of one or more physical memory devices. A set of memory devices typically comprises those memory devices whose bits are combined to create a data word of the width supported by the particular memory system architecture, and which would therefore be set as a group to a particular power consumption mode. For example, a set of memory devices might comprise a rank of memory devices. Each group includes free memory indicators corresponding to free memory regions or pages within the corresponding set of physical memory devices.

[0063]FIG. 6 shows four groups, corresponding to four different sets or ranks of memory devices, Rank A, Rank B, Rank C, and Rank D, each of which is shown in its own row. Within Rank A, there are two free physical memory pages. The free page indicators corresponding to these two free memory pages are grouped within the linked list, meaning that they are adjacent each other in the linked order. Similarly, Rank B has four free pages, which are grouped or located adjacent in the linked list.

[0064] Within the linked list, the indicators are sorted by group, in an order that is based on the relative current memory allocations from the corresponding sets of physical memory devices. More specifically, the groups are sorted in order from the group corresponding to the memory rank having the most memory allocations to the group corresponding to the memory rank having the fewest memory allocations. In some cases, this is equivalent to an order beginning with the group having the fewest free pages to the group having the most free pages.

[0065] In the example of FIG. 6, the first group in the sorted order corresponds to the memory rank having the fewest number of free pages, which is Rank C. The second group corresponds to the memory rank having the second fewest number of free pages, which is Rank A. The last group in the order is that group having the highest number of free pages, which in this example are Rank D and Rank B.

[0066] When allocating physical memory, the memory is allocated in the order of the sorted free region list, so that physical memory is allocated preferentially from those sets of physical memory devices having relatively higher current allocations of memory regions. In the example of FIG. 6, memory is allocated first from Rank C, then from Rank A, then from Rank D, and then from Rank B if necessary.

[0067] The sorting is preferably repeated periodically, as new physical memory pages become available.

[0068] Allocating memory in this manner tends to consolidate memory usage on relatively fewer physical memory devices. Periodically, the operating system or virtual memory system identifies those ranks or devices having relatively fewer memory allocations—those with the largest number of free pages, at the bottom of the free region list—and sets those devices to reduced power modes. In some cases, it might be desirable to identify only those memory devices or ranks that have no current allocations, and to set only those devices to the reduced power mode. In other cases, it is desirable to identify those memory devices or ranks that have the least frequently and/or least recently accessed memory locations, and set these devices to a reduced power mode.

[0069] In order to implement the described free page management technique, the operating system will typically be configured with information regarding the physical layout of memory, such as the address boundaries of memory ranks. This information is used to determine the different groups of free page indicators. Information regarding physical memory layout can be provided in different ways. For example, the memory controller might be designed to support queries regarding memory layout. In this case, the operating system would simply query the memory controller for this information. Alternatively, memory layout information might be provided by an operator as initial set-up information when configuring a computer. As yet another alternative, memory layout information may be provided as part of the system BIOS.

[0070] Although the technique of free page management has been described in the context of an operating system and its virtual memory subsystem, similar free page management techniques can be applied in the embodiments described with reference to FIGS. 1-3, in which a hardware-based memory controller creates mappings from a logical address space to actual physical memory devices. Specifically, a memory controller can maintain a sorted free page list corresponding to free pages of physical memory. When creating new logical-to-physical address mappings, the controller can create the mappings to first target those physical memory pages at the top of the sorted list, to ensure that physical memory is used first from those devices that are already heavily utilized.

[0071] Furthermore, it is recognized that the described techniques can in many cases be implemented alternatively in software, hardware, or a combination of both. In the case of software, an implementation might comprise one or more computer-readable storage media containing instructions and instruction sequences that are executable by a processor to perform the actions and techniques described above. In the case of hardware, the same or similar actions might be implemented as non-instruction-based logic components embodied on a hardware substrate such as a circuit board or silicon chip.

[0072] Conclusion

[0073] The techniques described above can be used in many systems to produce significant power savings. Furthermore, such power savings will often have few or no detrimental side-effects, because the power-saving measures are taken with respect to memory areas that are not actually being used or that are being used relatively lightly. The described techniques can therefore avoid or greatly diminish the prior art tradeoff between access speed and power savings.

[0074] Although details of specific implementations and embodiments are described above, such details are intended to satisfy statutory disclosure obligations rather than to limit the scope of the following claims. Thus, the invention as defined by the claims is not limited to the specific features described above. Rather, the invention is claimed in any of its forms or modifications that fall within the proper scope of the appended claims, appropriately interpreted in accordance with the doctrine of equivalents. 

1. A method comprising: creating mappings from a logical address space to physical memory; identifying portions of the logical address space based on usage; modifying the mappings to reduce the number of physical memory devices that are targeted by the mappings.
 2. A method as recited claim 1, wherein the mappings comprise mappings from one or more virtual address spaces to a physical address space.
 3. A method as recited claim 1, further comprising receiving memory instructions that reference memory in terms of the logical address space.
 4. A memory controller configured to perform actions comprising: receiving memory instructions that reference memory in terms of a logical address space; identifying portions of the logical address space based on usage; and mapping the identified portions of the logical address space to physical memory in a manner that reduces the number of physical memory devices referenced by the identified portions of the logical address space.
 5. A memory controller as recited in claim 4, wherein the identifying action comprises: monitoring the memory instructions to determine more frequently used portions of the logical address space.
 6. A memory controller as recited in claim 4, wherein the identifying action comprises: monitoring the memory instructions to determine more recently used portions of the logical address space.
 7. A memory controller as recited in claim 4, wherein the identifying action comprises: receiving notifications regarding logical memory allocations and de-allocations.
 8. A memory controller as recited in claim 4, wherein the identifying action comprises: receiving notifications regarding actual usage of logical memory addresses.
 9. A memory controller as recited in claim 4, wherein the identifying action comprises: maintaining one or more in-use registers indicating whether corresponding portions physical memory are currently in use.
 10. A memory controller as recited in claim 4, the actions further comprising: identifying one or more memory devices that are not referenced by the identified portions of the logical address space; and setting said one or more identified memory devices to a reduced power mode.
 11. A memory controller as recited in claim 4, wherein the identifying action comprises monitoring the memory instructions to determine more frequently used portions of the logical address space, the memory controller being configured to perform further actions comprising: identifying one or more memory devices that are not referenced by the identified portions of the logical address space; and setting said one or more identified memory devices to a reduced power mode.
 12. A memory controller as recited in claim 4, wherein the identifying action comprises monitoring the memory instructions to determine more recently used portions of the logical address space, the memory controller being configured to perform further actions comprising: identifying one or more memory devices that are not referenced by the identified portions of the logical address space; and setting said one or more identified memory devices to a reduced power mode.
 13. A memory controller as recited in claim 4, the actions further comprising: identifying one or more physical memory areas that are referenced by the identified portions of the logical address space; and setting said one or more physical memory areas to a reduced power mode.
 14. A memory controller as recited in claim 4, wherein the identifying action comprises monitoring the memory instructions to determine more frequently used portions of the logical address space, the memory controller being configured to perform further actions comprising: identifying one or more physical memory areas that are not referenced by the identified portions of the logical address space; and setting said one or more physical memory areas to a reduced power mode.
 15. A memory controller as recited in claim 4, wherein the identifying action comprises monitoring the memory instructions to determine more recently used portions of the logical address space, the memory controller being configured to perform further actions comprising: identifying one or more physical memory areas that are not referenced by the identified portions of the logical address space; and setting said one or more physical memory areas to a reduced power mode.
 16. A memory controller as recited in claim 4, the actions further comprising periodically repeating the identifying and mapping actions to repeatedly reduce the number of physical memory devices referenced by the identified portions of the logical address space.
 17. A memory controller as recited in claim 4, the actions further comprising: periodically repeating the identifying and mapping actions to repeatedly reduce the number of physical memory devices referenced by the identified portions of the logical address space; and prior to any repeated mapping action, moving affected portions of physical memory so that each logical address continues to reference the same data.
 18. A memory controller configured to perform actions comprising: receiving memory instructions that reference memory in terms of a logical address space; determining relative usages of different portions of the logical address space; and mapping the portions of the logical address space to physical memory device ranks in accordance with the relative usages of the different portions so that successive ranks of memory devices receive progressively lower relative usages.
 19. A memory controller as recited in claim 18, further comprising operating the ranks of memory devices in different power modes depending on their relative usages.
 20. A memory controller as recited in claim 18, wherein the determining action comprises: monitoring the memory instructions to determine more frequently used portions of the logical address space.
 21. A memory controller as recited in claim 18, wherein the determining action comprises: monitoring the memory instructions to determine more recently used portions of the logical address space.
 22. A memory controller as recited in claim 18, wherein the determining action comprises: receiving notifications regarding logical memory allocations and de-allocations.
 23. A memory controller as recited in claim 18, wherein the determining action comprises: receiving notifications regarding actual usage of logical memory addresses.
 24. A memory controller as recited in claim 18, wherein the determining action comprises: maintaining one or more in-use registers indicating whether corresponding portions physical memory are currently in use.
 25. A method of managing memory, comprising: monitoring memory accesses to identify portions of a logical address space based on usage; and periodically re-mapping the logical address space to physical memory to reduce the number of physical memory devices referenced by the identified portions of the logical address space.
 26. A method as recited in claim 25, wherein the monitoring comprises monitoring the memory instructions to determine more frequently used portions of the logical address space.
 27. A method as recited in claim 25, further wherein the monitoring comprises monitoring the memory instructions to determine more recently used portions of the logical address space.
 28. A method as recited in claim 25, further comprising: receiving memory instructions that reference memory in terms of the logical address space; and monitoring the memory instructions to identify the portions of the logical address space.
 29. A method as recited in claim 25, wherein the identified portions of the logical address space are those portions that are used least frequently, further comprising: identifying one or more memory devices that are not referenced by the identified portions of the logical address space; and setting said one or more identified memory devices to a reduced power mode.
 30. A method as recited in claim 25, wherein the identified portions of the logical address space are those portions that are used least recently, further comprising: identifying one or more memory devices that are not referenced by the identified portions of the logical address space; and setting said one or more identified memory devices to a reduced power mode.
 31. A method as recited in claim 25, wherein the identified portions of the logical address space are those portions that are used least frequently, further comprising: identifying one or more physical memory areas that are not referenced by the identified portions of the logical address space; and setting said one or more physical memory areas to a reduced power mode.
 32. A method as recited in claim 25, wherein the identified portions of the logical address space are those portions that are used least recently, further comprising: identifying one or more physical memory areas that are not referenced by the identified portions of the logical address space; and setting said one or more physical memory areas to a reduced power mode.
 33. A method as recited in claim 25, further comprising: prior to any re-mapping action, moving affected portions of physical memory so that each logical address continues to reference the same data.
 34. A method of managing memory, comprising: receiving notifications of newly allocated logical memory; in response to a notification of newly allocated logical memory, mapping the newly allocated logical memory to physical memory in a manner that reduces the number of additional physical memory devices referenced by newly allocated logical memory.
 35. A method as recited in claim 34, further comprising: maintaining one or more in-use registers indicating whether corresponding portions of physical memory are currently subject to a logical memory mapping.
 36. A method as recited in claim 34, further comprising: receiving notifications of logical memory de-allocations.
 37. A method as recited in claim 34, further comprising: identifying one or more memory devices based on relative usage; and setting said one or more identified memory devices to a reduced power mode.
 38. A method as recited in claim 34, further comprising: identifying one or more physical memory areas based on relative usage; and setting said one or more physical memory areas to a reduced power mode.
 39. A method as recited in claim 34, further comprising: receiving notifications of logical memory de-allocations; in response to receiving a notification of a logical memory de-allocation, re-mapping currently allocated portions of logical memory to reduce the number of physical memory devices referenced by allocated portions of logical memory.
 40. A system comprising: a plurality of physical memory devices containing physical memory; a memory controller configured to reference the physical memory in response to received memory instructions specifying addresses in terms of a logical address space; an operating system configured to dynamically allocate memory from the logical address space and to identify allocated portions of the logical address space to the memory controller; wherein the memory controller is configured to respond to the operating system by mapping allocated portions of the logical address space to corresponding portions of physical memory in a manner that tends to reduce the number of physical memory devices referenced by the allocated portions of the logical address space.
 41. A system as recited in claim 40, wherein: the operating system is further configured to dynamically de-allocate memory from the logical address space and to identify the de-allocated portions of the logical address space to the memory controller; the memory controller is further configured to respond to identifications of de-allocated portions of the logical address space by re-mapping currently allocated portions of logical memory to reduce the number of physical memory devices referenced by allocated portions of logical memory.
 42. A system as recited in claim 40, wherein the memory controller is configured to maintain one or more in-use registers indicating which portions of physical memory are currently in use.
 43. A system as recited in claim 40, further comprising one or more in-use registers that are configurable to indicate which portions of physical memory are currently in use.
 44. A system as recited in claim 40, wherein the memory controller is configured to perform actions comprising: identifying one or more physical memory devices based on relative usage; and setting said one or more identified physical memory devices to a reduced power mode.
 45. A system as recited in claim 40, wherein the memory controller is configured to perform actions comprising: identifying one or more physical memory areas based on relative usage; and setting said one or more identified physical memory areas to a reduced power mode.
 46. A method of memory management comprising: maintaining a free region list indicating free memory regions for potential allocation from physical memory devices; sorting the free region list in an order that is based on the relative current allocations of memory regions from respective sets of one or more physical memory devices; allocating memory regions indicated by the sorted free region list on the sorted order so that the memory regions are allocated preferentially from those physical memory devices having higher relative current allocations of memory regions.
 47. A method as recited in claim 46, further comprising: identifying one or more memory devices having relatively lower current allocations of memory regions; setting said one or more identified physical memory devices to a reduced power mode.
 48. A method as recited in claim 46, further comprising: maintaining the free region list as a linked list of free region indicators.
 49. A method as recited in claim 46, further comprising: repeatedly re-sorting the free region list in said order.
 50. A method of memory management comprising: maintaining a free region list containing indications of free memory regions of physical memory devices; grouping the indications of free memory regions within the free region list, wherein each group corresponds to a set of one or more physical memory devices, each group including indications of free memory regions within the corresponding set of physical memory devices; sorting the free region list by group in a group order that is based on relative current allocations of memory regions from the corresponding sets of physical memory devices; and allocating memory regions from the sorted free region list in the sorted order so that the memory regions are allocated preferentially from those physical memory devices having relatively higher current allocations of memory regions.
 51. A method as recited in claim 50, further comprising: identifying one or more memory devices having relatively lower current allocations of memory regions; setting said one or more identified physical memory devices to a reduced power mode.
 52. A method as recited in claim 50, further comprising: maintaining the free region list as a linked list of free region indicators.
 53. A method as recited in claim 50, further comprising: maintaining the free region list as a two-level linked list, wherein groupings are linked on a first level and indications are linked on a second level.
 54. A method as recited in claim 50, further comprising: repeatedly re-sorting the groupings in said order.
 55. One or more computer-readable media containing instructions that are executable to perform actions comprising: maintaining a free region list containing indications of free memory regions of physical memory devices; grouping the indications of free memory regions within the free region list, wherein each group corresponds to a set of one or more physical memory devices, each group including indications of free memory regions within the corresponding set of physical memory devices; repeatedly sorting the free region list by group in an order that is based on relative current allocations of memory regions from the corresponding physical memory devices; when allocating physical memory, allocating in the order of the sorted free region list so that physical memory is allocated preferentially from those sets of physical memory devices having relatively higher current allocations of memory regions; identifying one or more of the physical memory devices that have relatively lower current allocations of memory regions; and setting said one or more identified physical memory devices to a reduced power mode.
 56. One or more computer-readable media as recited in claim 55, further comprising: maintaining the free region list as a linked list of free region indicators. 